package cn.bigway.app.weavingdesigner.main;

import java.util.EnumSet;

import javax.swing.JMenuBar;

import cn.bigway.app.weavingdesigner.type.WdMenuType;

final class WdMenuBar extends JMenuBar {

	private static final long serialVersionUID = -5453147424050654392L;

	private static final WdMenuBar menuBar;

	private WdMenuBar() {
		//
	}

	public static WdMenuBar getInstance() {
		return menuBar;
	}

	static {
		menuBar = new WdMenuBar();

		EnumSet<WdMenuType> menuTypes = EnumSet.allOf(WdMenuType.class);
		for (WdMenuType type : menuTypes) {
			menuBar.add(WdMenuFactory.getInstance().get(type));
		}
	}
}
